package io.renren.utils;

import java.io.Serializable;

@SuppressWarnings("serial")
public class Page implements Serializable{

	private int pageNo;
	
	private int pageSize;
	
	private long totalCount;
	
	private int pageEnd;
	
	public Page () {
		
	}
	
	public Page(int pageNo ,int pageSize,long totalCount) {
		this.pageNo = pageNo;
		this.pageSize = pageSize;
		setTotalCount(totalCount);
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
		
		if(totalCount%pageSize==0){
    		pageEnd=(int) (totalCount/pageSize);
    	}else{
    		pageEnd=(int) (totalCount/pageSize)+1;
    	}
	}

	public int getPageEnd() {
		
		return pageEnd;
	}

	public void setPageEnd(int pageEnd) {
		this.pageEnd = pageEnd;
	}
	
}
